# -*- encoding:utf-8 -*-
# !/usr/bin/env python
'''
    python-0824-02.py
    ======================
    @descript: 创建进程
    @copyright:nnz
    @author:dln
    @date: 2021/8/23 19:26
    @version:v1.0
'''
import os
import multiprocessing


def f_01(pum):
    print('进程：{}-{}开始'.format(os.getpid(),os.getppid()))
    for element in range(1,pum+1):
        print('进程{}输出的值为{}'.format(os.getpid(),element))
        pass
    print('进程{}结束'.format(os.getpid(),os.getppid()))
    pass
if __name__=='__main__':
    print('进程：{}-{}开始'.format(os.getpid(), os.getppid()))
    v_result01=multiprocessing.Process(target=f_01,args=(10,))
    v_result02=multiprocessing.Process(target=f_01,args=(7,))
    v_result03=multiprocessing.Process(target=f_01,args=(5,))
    v_result01.start()
    v_result02.start()
    v_result03.start()
    print('进程{}结束'.format(os.getpid(),os.getppid()))
    pass
